import { pget, ppostJson,  postFileByFormData } from '@/utils/req';
import { modalApi } from '@/utils/modalReq';

// 事故理赔列表
export function getTableList(query?: any) {
  return pget(`${modalApi.carMessage}/assetsAccidentSettle/page`, query);
}

// 理赔编辑
export function editAccident(data: any) {
  return ppostJson(`${modalApi.carMessage}/assetsAccidentSettle/update`, data);
}

// 查看证照详情
export function viewAccident(query: any) {
  return pget(`${modalApi.carMessage}/assetsAccidentSettle/detail`, query);
}

// 导入验证
export const checkData = `${modalApi.carMessage}/assetsAccidentSettle/importAccident`;

// 文件上传
export function importAccident(data: any) {
  return postFileByFormData(
    `${modalApi.carMessage}/assetsAccidentSettle/importAccident`,
    data,
  );
}

// 导入错误列表
export function getErrorList(query?: any) {
  return pget(
    `${modalApi.carMessage}/assetsaccidentdataprocessing/page`,
    query,
  );
}

// 插入导入数据
export function saveSuccessData(query?: any) {
  return ppostJson(
    `${modalApi.carMessage}/assetsAccidentSettle/saveSuccessData`,
    query,
  );
}

// 取消导入删除中间表数据
export function saveremove(data?: any) {
  return ppostJson(
    `${modalApi.carMessage}/assetsaccidentdataprocessing/remove?type=${data.type}`,
    data,
  );
}

// 批量上传事故理赔图片
export function batchImg(data?: any) {
  return ppostJson(
    `${modalApi.carMessage}/assetsAccidentSettle/uploadSettleBasePhoto`,
    data,
  );
}
